#include <iostream>

using namespace std;
int divide(int x, int y)
{
    if (y == 0)
        throw 0;
    return x / y;
}

void test()
{
    int a, b;
    try
    {
        cout << "请输入两个整数a和b（用于计算a除以b的商）：";
        cin >> a >> b;
        int k = divide(a, b);
        cout << a << "/" << b << "=" << k;
    }
    catch (int)
    {
        cout << "重新输入整数a和b（b的值不能为0）：";
        cin >> a >> b;
        int k = divide(a, b);
        cout << a << "/" << b << "=" << k << endl;
    }
}

int main()
{
    try
    {
        test();
    }
    catch (int)
    {
        cout << "请重新运行程序!" << endl;
    }
    return 0;
}